﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title id='Description'>To switch to a right-to-left representation, just enable a single property - "rtl". When this property is on, the layout of jqxDataTable's UI elements is reversed.</title>
    <meta name="description" content="Right-To-Left Layout - jQuery DataTable | jQWidgets">
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> 
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdatatable.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxpanel.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxradiobutton.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script>
    <script type="text/javascript" src="../sampledata/generatedata.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var source =
            {
                localData: generatedata(200),
                dataType: "array",
                datafields:
                [
                    { name: 'firstname', type: 'string' },
                    { name: 'lastname', type: 'string' },
                    { name: 'productname', type: 'string' },
                    { name: 'quantity', type: 'number' },
                    { name: 'price', type: 'number' },
                    { name: 'total', type: 'number' }
                ]
            };

            var dataAdapter = new $.jqx.dataAdapter(source);

            $("#dataTable").jqxDataTable(
            {
                width: 550,
                source: dataAdapter,                
                pageable: true,
                altRows: true,
                sortable: true,
                rtl: true,
                columns: [
                  { text: 'Name', dataField: 'firstname', align: 'right', cellsAlign: 'right', width: 100 },
                  { text: 'Last Name', dataField: 'lastname', align: 'right', cellsAlign: 'right', width: 100 },
                  { text: 'Product', editable: false, dataField: 'productname', align: 'right', cellsAlign: 'right', width: 180 },
                  { text: 'Quantity', dataField: 'quantity', width: 80, cellsAlign: 'left', align: 'left' },
                  { text: 'Unit Price', dataField: 'price', width: 80, cellsAlign: 'left', align: 'left' },
                  { text: 'Total', dataField: 'total', width: 80, cellsAlign: 'left', align: 'left', cellsformat: 'c2' }
                ]
            });          
        });
    </script>
</head>
<body class='default'>
    <div id="dataTable">
    </div>
</body>
</html>
